<?php

/**
 * alltosun.com 企业管理模块 index.php
 * ============================================================================
 * 版权所有 (C) 2009-2012 北京互动阳光科技有限公司，并保留所有权利。
 * 网站地址: http://www.alltosun.com
 * ----------------------------------------------------------------------------
 * 许可声明：这是一个开源程序，未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * $Author: 韦仕达 (weisd@alltosun.com) $
 * $Date: 2012-9-21 下午6:20:00 $
 * $Id: index.php 25301 2013-04-24 13:45:50Z qianym $
*/

class Action
{
    protected $user_id;
    protected $company_id;

    /**
     * 登陆人员权限控制
     */
    public function __construct()
    {
        $this->user_id = user_helper::get_user_id();
        $this->company_id = company_helper::get_company_id();

        if (empty($this->user_id) || !user_helper::is_company_manager($this->company_id, $this->user_id)) {
            throw new AnMessageException('请以管理员身份登陆', 'error', AnUrl('user/login'));
        }
    }
    /*
     * 显示管理页
     */
    function __call($action = '', $param = array())
    {
        $member_num = company_helper::get_total_members($this->company_id);
        $file_num   = company_helper::get_total_files($this->company_id);

        Response::assign('member_num', $member_num);
        Response::assign('file_num', $file_num);
        Response::display('index.html');
    }
}
?>